<?php

namespace LowCode\Traits\Props;

use LowCode\Support\JsExp;

/**
 * 设置组件大小尺寸
 */
trait HasSize
{
    /**
     * 设置组件大小尺寸
     * @param string|JsExp $size 'small' | 'medium' | 'large'
     * @return $this
     */
    public function size(string|JsExp $size = 'small' | 'medium' | 'large'): static
    {
        return $this->prop('size',$size);
    }

    /**
     * 设置组件小尺寸
     * @return $this
     */
    public function small(): static
    {
        return $this->size('small');
    }

    /**
     * 设置组件默认尺寸
     * @return $this
     */
    public function medium(): static
    {
        return $this->size('medium');
    }

    /**
     * 设置组件大尺寸
     * @return $this
     */
    public function large(): static
    {
        return $this->size('large');
    }
}
